package com.piggy.logi.sys.mapper;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.piggy.common.core.web.page.BaseMapperPlus;
import com.piggy.logi.sys.bo.LogiWaybillAgentPayQueryBo;
import com.piggy.logi.sys.domain.LogiWaybillAgentPay;
import com.piggy.logi.sys.vo.LogiWaybillAgentPayVo;
import org.apache.ibatis.annotations.Param;

/**
 * 代收货款Mapper接口
 *
 * @author fengxy
 * @date 2023/10/17 21:48
 **/
public interface LogiWaybillAgentPayMapper extends BaseMapperPlus<LogiWaybillAgentPay> {

    Page<LogiWaybillAgentPayVo> queryPageList(@Param("page") Page<LogiWaybillAgentPayVo> page, @Param("bo") LogiWaybillAgentPayQueryBo bo);

    LogiWaybillAgentPayVo getVoById(@Param("id") Long id);

    default void removeByUK(Long deptId, Long waybillId) {
        delete(Wrappers.<LogiWaybillAgentPay>lambdaQuery()
                .eq(LogiWaybillAgentPay::getDeptId, deptId)
                .eq(LogiWaybillAgentPay::getWaybillId, waybillId));
    }
}
